package com.skit.common.utils;

import android.content.res.Resources;

/**
 * @author shuike <a href="mailto:shuike007@gmail.com">Contact me.</a>
 * @version 1.0
 * @since 2020/4/27
 */
public class DensityUtils {
    public static int dp2px(int dip) {
        return (int) (dp2pxFloat(dip) + 0.5);
    }

    public static float dp2pxFloat(int dip) {
        return Resources.getSystem().getDisplayMetrics().density * dip;
    }
}
